<h1>Traceability report</h1>
<%= link_to('Back to requirements', {:action=>'index'}, {:class=>'button'}) %><br/>
<br/>
<h2>No upward requirements</h2>
<ol id="req_up">
<%= render(:partial=>'req', :collection=>@up) %>
</ol>

<h2>Not derived requirements</h2>
<ol id="req_down">
<%= render(:partial=>'req', :collection=>@down) %>
</ol>

<h2>Traceability</h2>

<%= link_to_function('Toggle requirements', "toggle_column('trac', 1);return false;") %><br/>
<br/>
<table id="trac">
<tr>
<td>From</td>
<td>Requirement</td>
<td>To</td>
</tr>
<% for req in @reqs %>
<% sr = req.subreqs %>
<tr>
<td valign="top"><%=req.reference%></td>
<td valign="top"><%=req.text%></td>
<td valign="top">
<% if sr.size == 0 %>
<b>not derived</b>
<% else %>
<%=sr.collect{|r| r.reference}.join(", ")%>
<% end %>
</td>
</tr>
<% end %>
</table>

